package com.example.hotel_demo.service;


import com.example.hotel_demo.mapper.RoomTypeMapper;
import com.example.hotel_demo.pojo.RoomType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoomTypeService {
    @Autowired
    private RoomTypeMapper roomTypeMapper;

    public List<RoomType> getRoomTypeAll(){
        List<RoomType> roomTypes =   roomTypeMapper.getRoomTypeAll();
        return roomTypes;
    }

    public int getTypeCount(){
        return roomTypeMapper.getTypeCount();
    }
    public RoomType getRoomTypeByName(String typeName){
        return roomTypeMapper.getRoomTypeByName(typeName);
    }

    public int addRoomType(String typeName,int roomPrice,int roomArea, int rateNum, int rateBed){
        return roomTypeMapper.addRoomType(typeName,roomPrice,roomArea,rateNum,rateBed);
    }

    public int updateRoomPriceByTypeName(String typeName ,int roomPrice){
        return roomTypeMapper.updateRoomPriceByTypeName(typeName,roomPrice);
    }

    public int deleteRoomTypeByTypeName(String typeName){
        return roomTypeMapper.deleteRoomTypeByTypeName(typeName);
    }

    public int updateroomNum(RoomType roomType){
        return roomTypeMapper.updateroomNum(roomType);
    }
    public RoomType findById(int typeID){
        return roomTypeMapper.findById(typeID);
    }
}
